<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<jsp:include page="/WEB-INF/jspf/header.jsp">
    <jsp:param name="title" value="View Details" />
</jsp:include>

<f:view>
    <h:form>
        <h:inputHidden binding="#{customer.inputHidden}"  value="#{customer.customerId}" />
        <h:inputHidden value="#{account.customerId}" />

        <h:panelGrid columns="2" >
            <h:panelGroup >
                <%@include file="/WEB-INF/jspf/menu_manager.jspf" %>
            </h:panelGroup>

            <f:subview id="customerDetails">
                <h2>  <h:outputText value="Customer Details" /></h2>
                <h:panelGrid columns="3">
                    <h:outputText value="Transaction Limit:"/>
                    <h:inputText id="limit" value="#{customer.limit}" label="limit" title="limit" required="true"  validatorMessage="Amount value is not correct."  requiredMessage="Value is required." >
                        <f:validateDoubleRange minimum="0.01"  />
                    </h:inputText>
                    <h:message for="limit" errorClass="error"/>
                    <h:outputText value="Limit Currency:"/>
                    <h:selectOneMenu validatorMessage="Currency Error" requiredMessage="Currency Error." id="currency" required="true" value="#{customer.currencyLimit}">
                        <f:converter converterId="CurrencyConverter" />
                        <f:selectItems value="#{account.currencyChoices}" />
                    </h:selectOneMenu>
                    <h:message for="currency" errorClass="error"/>

                    <h:outputText value="FirstName:"/>
                    <h:inputText id="firstName"   value="#{customer.firstName}" title="FirstName" required="true" requiredMessage="Value is required."/>
                    <h:message for="firstName"  errorClass="error"/>
                    <h:outputText value="LastName:"/>
                    <h:inputText  id="lastName" value="#{customer.lastName}" title="LastName"  required="true" requiredMessage="Value is required."/>
                    <h:message for="lastName"  errorClass="error"/>
                    <h:outputText value="Login:"/>
                    <h:inputText id="login" value="#{customer.login}" title="Login"  required="true" requiredMessage="Value is required."/>
                    <h:message for="login"  errorClass="error"/>
                    <h:outputText value="Id:"/>
                    <h:outputText id="customerId" value="#{customer.inputHidden.value}" title="Id" />

                </h:panelGrid>
                <h:commandButton action="#{customer.edit}" value="Edit">
                </h:commandButton>

            </f:subview>


        </h:panelGrid>

    </h:form>
    </body>
    </html>

</f:view>
